package com.easyCms.base.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.easyCms.base.entity.BsStaticType;

public abstract interface BsStaticTypeDAO
		extends PagingAndSortingRepository<BsStaticType, Long>, JpaSpecificationExecutor<BsStaticType> {
	@Query("select bst from BsStaticType bst where bst.state=1")
	public abstract List<BsStaticType> getAll();

	@Modifying
	@Query("UPDATE BsStaticType bst SET bst.state=-1 WHERE bst.id=?1")
	public abstract void deletes(Long paramLong);

	@Query("select bst from BsStaticType bst where bst.state=1 and bst.code=?1 ")
	public abstract List<BsStaticType> getByCode(String paramString);
}